home *** CD-ROM | disk | FTP | other *** search
- str mptcmd [127];
- main()
- {
- int lfp, len, c, first, last, ret;
- str fullpath [80];
- str file[80];
- str port [4];
- str protocol[5]="mpt"; // puma users: change "mpt" to "puma"
-
- lfp=fopen ("mptlist","w");
- if (lfp == -1) {
- prints ("cannot open list file");
- return (0);
- }
-
- len=strlen (_ext_filespec);
- first=0;
- last=0;
- while (last < len) {
- last=strchr (_ext_filespec, first, ' ');
- if (last == -1) last = len;
- substr (_ext_filespec,first,last-first,file);
- if (first == 0) {
- // first file already has dir prepended.
- fputs (file,lfp);
- }
- else {
- if (strchr (file, 0, '\') == -1 && subchr (file, 1) != ':') {
- fullpath = _up_dir;
- strcat (fullpath,file);
- fputs (fullpath,lfp);
- }
- else fputs (file,lfp);
- }
- fputs ("^M^J",lfp);
- first=last+1;
- }
- fclose (lfp);
- mptcmd="N+ F+ M- P";
- itos (get_port(), port);
- strcat (mptcmd, port); // add port
- strcat (mptcmd, " S0"); // port speed (0=auto adjust)
- if (_zmod_scrash) strcat (mptcmd, " R+"); // resume file
- else strcat (mptcmd, " O+"); // overwrite file
- if (_sound_on) strcat (mptcmd, " B+"); // beep when finished
- else strcat (mptcmd, " B-"); // silence
- strcat (mptcmd, " X+ s @mptlist");
- prints (mptcmd);
- ret=run (protocol,mptcmd,0);
- fdelete ("mptlist");
- if (_sound_on) {
- if (ret) {
- // command failed. descending tones
- for (c=1; c<=3; ++c) {
- tone (790,17);
- tone (657,17);
- tone (530,17);
- }
- }
- else {
- // command succeeded. ascending tones
- for (c=1; c<=3; ++c) {
- tone (530,17);
- tone (657,17);
- tone (790,17);
- }
- }
- }
- return (0);
- }
-